﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Configuration;

namespace SIOGDE.Reportes.Negocios.Shared
{
    public class ReportsClassNames
    {
        public const string FilePersonalReport = "SIOGDE.Reportes.FilePersonal, SIOGDE.Reportes";
        public const string MemoAsignacionReport = "SIOGDE.Reportes.MemoAsignacionDestino, SIOGDE.Reportes";
        public const string RequerimientoConfigReport = "SIOGDE.Reportes.RequerimientoConfig, SIOGDE.Reportes";
        public const string DestinoPersonalReport = "SIOGDE.Reportes.DestinoPersonal, SIOGDE.Reportes";
        public const string RequerimientoPorArmaReport = "SIOGDE.Reportes.RequerimientoPorArmaReport, SIOGDE.Reportes";
        public const string RolUsuarioReport = "SIOGDE.Reportes.RolUsuario, SIOGDE.Reportes";
    }

    public class ReportParameterNames
    {
        public const string Renderator = "Renderator";
        public const string RenderFormat = "RenderFormat";

        public const string PersonaId = "PersonaId";
        public const string GestionId = "GestionId";

        public const string RolId = "RolId";

        public const string GuidAsignacion = "GuidAsignacion";

        public const string UnidadIds = "UnidadIds";
        public const string ArmaIds = "ArmaIds";
    }

    public class ReportBuilder
    {
        public static string GetDeploymentURL()
        {
            //return System.Configuration.ConfigurationSettings.AppSettings["DeploymentURL"];
            return WebConfigurationManager.AppSettings["DeploymentURL"];
        }

        public static string BuildURL(Dictionary<string, string> dictionary)
        {
            string param = Didsoft.Mvc.Security.DicParams.BuildParam(dictionary);
            string encoded = System.Web.HttpUtility.UrlEncode(param);
            return GetDeploymentURL() + "Reportes/VerReporte.aspx?param=" + encoded;
        }

    }
}
